<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:s="http://jboss.com/products/seam/taglib">
<body>
    <ui:composition template="/WEB-INF/template.xhtml">
        <ui:define name="topnav">
            <ui:include src="/WEB-INF/incl/admin_nav.xhtml" />
        </ui:define>

        <ui:define name="sidebar">
            <ui:include src="/WEB-INF/incl/login.xhtml" />
            <ui:include src="/WEB-INF/incl/stats.xhtml" />
            <ui:include src="/WEB-INF/incl/processmenu.xhtml" />
        </ui:define>
        
        <ui:define name="body">
            <h1>Order Acceptance</h1>

            <p>Please accept or reject the order.</p>

            <div class="cntInfo">
                <h:panelGrid id="AcceptancePanel" columns="2">
                    <h:outputText id="OrderText" value="Order" />
                    <h:outputText id="OrderIdValue" value="#{order.orderId}" />
                    
                    <h:outputText id="OrderDateText" value="Order date:" />
                    <h:outputText id="OrderDateValue" value="#{order.orderDate}">
                        <s:convertDateTime type="both" dateStyle="full"/> 
                    </h:outputText>
                    
                    <h:outputText id="NetAmountText" value="Net Amount:" />
                    <h:outputText id="NetAmountValue" value="#{order.netAmount}">
                        <f:convertNumber type="currency" currencySymbol="$" />
                    </h:outputText>
                    
                    <h:outputText id="TaxText" value="Tax:" />
                    <h:outputText id="TaxValue" value="#{order.tax}">
                        <f:convertNumber type="currency" currencySymbol="$" />
                    </h:outputText>
                    
                    <h:outputText id="TotalAmountText" value="Total Amount:" />
                    <h:outputText id="TotalAmountValue" value="#{order.totalAmount}">
                        <f:convertNumber type="currency" currencySymbol="$" />
                    </h:outputText>
                </h:panelGrid>
                
                <div class="cntInfo">
                    <h:dataTable id="OrderLinesDataTable"
                                 value="#{order.orderLines}" 
                                 var="item"
                                 styleClass="dvdtable" 
                                 headerClass="dvdtablehead"
                                 rowClasses="dvdtableodd,dvdtableeven"
                                 columnClasses="dvdtablecol">
                        <h:column id="quantityColumn">
                            <f:facet name="header">
                                <h:outputText id="QuantityText" value="#{messages.cartQuantityColumn}" />
                            </f:facet>
                            <h:outputText id="QuantityValue" value="#{item.quantity}" />
                        </h:column>                        
                        <h:column id="titleColumn">
                            <f:facet name="header">
                                <h:outputText id="TitleText" value="#{messages.cartTitleColumn}" />
                            </f:facet>
                            <h:outputText id="TitleValue" value="#{item.product.title}" />
                        </h:column>                        
                        <h:column id="actorColumn">
                            <f:facet name="header">
                                <h:outputText id="ActorText" value="#{messages.cartActorColumn}" />
                            </f:facet>
                            <h:outputText id="ActorValue" value="#{item.product.actors[0].name}" />
                        </h:column>                        
                        <h:column id="priceColumn">
                            <f:facet name="header">
                                <h:outputText id="PriceText" value="#{messages.cartPriceColumn}" />
                            </f:facet>
                            <h:outputText id="PriceValue" value="#{item.product.price}">
                                <f:convertNumber type="currency" currencySymbol="$" />
                            </h:outputText>
                        </h:column>                        
                    </h:dataTable>
                </div>                
                
                <h:form id="AcceptRejectForm">
                    <h:commandButton id="AcceptOrderButton" action="#{accept.reject}" value="Reject Order" /> 
                    <h:commandButton id="RejectOrderButton" action="#{accept.accept}" value="Accept Order" /> 
                </h:form>
            </div>
 
       </ui:define>
    </ui:composition>
</body>
</html>




